<?php
global $header;
global $footer;
global $menu;
global $featureManager;
global $currentUser;
global $project_list;
global $future_session_list;
global $current_session_list;
global $past_session_list;

$header['title'] = 'Web Dev Lab';
$header['page_id'] = 'home';

#$featureManager->apply("com.yizin.platform.site.menu", $menu);
#$header['menu'] = $menu['html'];
$featureManager->apply("com.yizin.platform.site.header", $header);
$featureManager->apply("com.yizin.platform.site.footer", $footer);
$featureManager->apply("com.yizin.site.get.name", $config);

?>
<?php echo $header['html']; ?>
	<div class="link-to">
		<a href="http://www.irm.cn/">School of Information Resource Management</a>
		<br />
		<a href="http://www.ruc.edu.cn/">Renmin University of China</a>
	</div>
	<ul class="main-menu">
		<li class="on">
			<a href="<?php echo REQUEST_BASE?>projects/">projects</a>
			<div class="menu-desc">
				<p class="menu-desc-text">
					See WDL's student-led projects, from campus resource search engine to integrated collaboration system, from Web 2.0 social site to framework for agile development, beyond your imagination.
				</p>
			</div>
		</li>
		<li>
			<a href="<?php echo REQUEST_BASE?>people/">people</a>
			<div class="menu-desc">
				<p class="menu-desc-text">
					See a directory of WDL's people: current student members, alumni and faculty. Explore their interests, skills and projects they participated in or led.
				</p>
			</div>
		</li>
		<li>
			<a href="<?php echo REQUEST_BASE?>seminars/">seminars</a>
			<div class="menu-desc">
				<p class="menu-desc-text">
					Check what there are of the future seminars, or see a full list of the past seminars. The seminars are totally WDL-style &mdash; lasting one hour, student-to-student, and problem-oriented. 
				</p>
			</div>
		</li>
	</ul>
</div>
<div id="main">
	<div class="main-wrapper clearfix">
		<div class="smn-recent clearfix">
			<h2 class="page-title clearfix"><a href="<?php echo REQUEST_BASE; ?>seminars/" class="seminars">seminars</a></h2>
			<ul class="smn-r-wrapper">
			<?php if ($future_session_list) {?>
				<li class="future clearfix">
					<p class="smn-r-when">Future</p>
					<ul class="smn-r-list">
						<?php foreach ($future_session_list as $session) {?>
						<li class="smn-r-container">
							<p class="smn-r-time"><?php echo date("D, M j, Y h:ia", strtotime($session['start_time'])). ' - ' . date("h:ia", strtotime($session['end_time']));?></p>
							<h3 class="smn-r-title">
								<a href="<?php echo REQUEST_BASE;?>seminars/<?php echo $session['id_session'];?>/">
									<?php echo $session['title']?>
								</a>
							</h3>
							<p class="smn-r-speaker"><span class="tsf-u">speaker</span>
								<a href='<?php echo REQUEST_BASE; ?>people/<?php echo strtolower($session['first_name']) . '_' . strtolower($session['last_name']);?>/' >
									<?php echo $session['first_name'] . ' ' . $session['last_name']; ?>
								</a>
							</p>
						</li>
						<?php } ?>
					</ul>
				</li>
			<?php }?>
			<?php if ($current_session_list) {?>
				<li class="this-week clearfix">
					<p class="smn-r-when">This Week</p>
					<ul class="smn-r-list">
						<?php foreach ($current_session_list as $session) {?>
						<li class="smn-r-container">
							<p class="smn-r-time"><?php echo date("D, M j, Y h:ia", strtotime($session['start_time'])). ' - ' . date("h:ia", strtotime($session['end_time']))?></p>
							<h3 class="smn-r-title">
								<a href="<?php echo REQUEST_BASE;?>seminars/<?php echo $session['id_session'];?>/">
									<?php echo $session['title']?>
								</a>
							</h3>
							<p class="smn-r-speaker"><span class="tsf-u">speaker</span>
								<a href='<?php echo REQUEST_BASE; ?>people/<?php echo strtolower($session['first_name']) . '_' . strtolower($session['last_name']);?>/' >
									<?php echo $session['first_name'] . ' ' . $session['last_name']; ?>
								</a>
							</p>
						</li>
						<?php } ?>
					</ul>
				</li>
			<?php }?>
			<?php if ($past_session_list) {?>
				<li class="past clearfix">
					<p class="smn-r-when">Past</p>
					<ul class="smn-r-list">
						<?php foreach ($past_session_list as $session) {?>
						<li class="smn-r-container">
							<p class="smn-r-time"><?php echo date("D, M j, Y h:ia", strtotime($session['start_time'])). ' - ' . date("h:ia", strtotime($session['end_time']));?></p>
							<h3 class="smn-r-title">
								<a href="<?php echo REQUEST_BASE;?>seminars/<?php echo $session['id_session'];?>/">
									<?php echo $session['title']?>
								</a>
							</h3>
							<p class="smn-r-speaker"><span class="tsf-u">speaker</span>
								<a href='<?php echo REQUEST_BASE; ?>people/<?php echo strtolower($session['first_name']) . '_' . strtolower($session['last_name']);?>/' >
									<?php echo $session['first_name'] . ' ' . $session['last_name']; ?>
								</a>
							</p>
						</li>
						<?php } ?>
					</ul>
				</li>
			<?php }?>
			</ul>
		</div>
	</div>
</div>
<script type="text/javascript">
	$(function(){
		$('.main-menu li a').mouseover(
			function(e){
				$('.main-menu li').removeClass('on');
				$(this).parent().addClass('on');
			}
		);
	})
</script>

<?= $footer['html'] ?>
